package org.gten.gegedexin.service.user.common;





public class ResResult<T> {


    public static Result suc(){
        return setResultCode(ResultCode.SUCCESS);
    }

    public static Result suc(String o){
        Result re = setResultCode(ResultCode.SUCCESS);
        re.setData(o);
        re.setIs_success(Boolean.TRUE);
        return re;
    }

    public static Result fail(ResultCode resultCode){
        return setResultCode(resultCode);
    }

    public static Result setResultCode(ResultCode code){
       Result result = new Result();
       if(code!=ResultCode.SUCCESS) result.setIs_success(Boolean.FALSE);
       result.setStatus(code.code());
       result.setResponse(code.message());
       return result;
    }


}
